# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=perl-email-address
pkgver=1.913
pkgrel=1
pkgdesc="RFC 2822 Address Parsing and Creation"
url="https://metacpan.org/release/Email-Address"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-capture-tiny"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/R/RJ/RJBS/Email-Address-$pkgver.tar.gz"
builddir="$srcdir/Email-Address-$pkgver"

# secfixes:
#   1.912-r0:
#     - CVE-2018-12558

build() {
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
	make
}

check() {
	make -C "$builddir" test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="
3c12c052cf7bc5738763f35e81eb328f990494774703ac204b516cec7faa985d262af79126e4068cb084ee4f3b56b1704bbe219288ff8efe5e61b6a62fcea901  Email-Address-1.913.tar.gz
"
